CREATE TABLE [dbo].[tb_Solicitudes]
(
[idSolicitud] [int] NOT NULL IDENTITY(1, 1),
[Alumno] [int] NOT NULL,
[Fecha] [datetime] NOT NULL CONSTRAINT [DF_tb_Solicitudes_Fecha] DEFAULT (getdate()),
[TipoSolicitud] [int] NOT NULL,
[Cantidad] [int] NOT NULL,
[Urgencia] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Observaciones] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FechaInicio] [datetime] NULL,
[FechaFin] [datetime] NULL,
[idLineaDeByP] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Solicitudes] ADD CONSTRAINT [PK_tb_Solicitudes] PRIMARY KEY NONCLUSTERED  ([idSolicitud]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_Alumno] ON [dbo].[tb_Solicitudes] ([Alumno]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Solicitudes] WITH NOCHECK ADD CONSTRAINT [FK_tb_Solicitudes_tb_Alumnos] FOREIGN KEY ([Alumno]) REFERENCES [dbo].[tb_Alumnos] ([idAlumno])
GO
ALTER TABLE [dbo].[tb_Solicitudes] WITH NOCHECK ADD CONSTRAINT [FK_tb_Solicitudes_tb_LineasDeBYP] FOREIGN KEY ([idLineaDeByP]) REFERENCES [dbo].[tb_LineasDeBYP] ([idLineaDeBYP])
GO
ALTER TABLE [dbo].[tb_Solicitudes] WITH NOCHECK ADD CONSTRAINT [FK_tb_Solicitudes_tb_TiposDeSolicitudes] FOREIGN KEY ([TipoSolicitud]) REFERENCES [dbo].[tb_TiposDeSolicitudes] ([idTipoSolicitud])
GO
